import instance from '@/utils/axios'

// bus
// 获取公交路线
export const getBuslist = () => {
  return instance({
    url: 'bus/get-route',
    method: 'post'
  })
}

// 获取公交路线-分页 bus/get-route-page
export const getBusPage = (data) => {
  return instance({
    url: 'bus/get-route-page',
    method: 'post',
    data
  })
}

// 获取公交客户
export const getBusCustomer = () => {
  return instance({
    url: 'bus/get-customer',
    method: 'post'
  })
}
// 关键词查询
export const getRouteStop = (data) => {
  return instance({
    url: 'bus/get-route-stop',
    method: 'post',
    data
  })
}
// 预约详细
export const getBookinginfo = (data) => {
  return instance({
    url: 'bus/booking/info',
    method: 'post',
    data
  })
}
// 关键词查询
export const getRouteInfo = (data) => {
  return instance({
    url: 'bus/get-route-info',
    method: 'post',
    data
  })
}
// 关键词查询
export const passlist = () => {
  return instance({
    url: 'bus/booking/pass-list',
    method: 'post'
  })
}
// car
// 获取公交车辆
export const getBusCar = (data) => {
  return instance({
    url: 'bus/get-car',
    method: 'post',
    data
  })
}
// 获取公交车辆
export const getUserCar = (data) => {
  return instance({
    url: 'bus/user/car/index',
    method: 'post',
    data
  })
}
// 获取公交车辆
export const getCarSave = (data) => {
  return instance({
    url: 'bus/user/car/save',
    method: 'post',
    data
  })
}
// 获取公交车辆
export const getCardel = (data) => {
  return instance({
    url: 'bus/user/car/del',
    method: 'post',
    data
  })
}
// 获取公交车辆
export const setMemberName = (data) => {
  return instance({
    url: 'bus/user/car/update',
    method: 'post',
    data
  })
}

// 获取公交车辆类型
export const getBusType = () => {
  return instance({
    url: 'bus/get-car-type',
    method: 'post'
  })
}
// 获取路线类型
export const getRouteType = () => {
  return instance({
    url: 'bus/get-route',
    method: 'post'
  })
}
// 获取路线类型
export const getCustomer = () => {
  return instance({
    url: 'bus/get-customer',
    method: 'post'
  })
}

// 获取公交车辆级别
export const getBusLevel = () => {
  return instance({
    url: 'bus/get-rank',
    method: 'post'
  })
}
// 添加公交车站
export const addBusStop = (data) => {
  return instance({
    url: 'bus/route/save-stop',
    method: 'post',
    data
  })
}

// 收藏-批量保存
export const setMulFavorite = (data) => {
  return instance({
    url: 'bus/favorite/batch-save',
    method: 'post',
    data
  })
}

// 收藏-单独保存
export const setFavorite = (data) => {
  return instance({
    url: 'bus/favorite/save',
    method: 'post',
    data
  })
}

// 收藏-清空列表
export const clearFavorite = (data) => {
  return instance({
    url: 'bus/favorite/reset',
    method: 'post',
    data
  })
}

// 收藏-删除某个收藏
export const delFavorite = (data) => {
  return instance({
    url: 'bus/favorite/delete',
    method: 'post',
    data
  })
}

// 我的收藏列表
export const getFavoriteList = (data) => {
  return instance({
    url: 'bus/favorite/index',
    method: 'post',
    data
  })
}

// 预约车辆
export const addCheckBus = (data) => {
  return instance({
    url: 'bus/booking/add',
    method: 'post',
    data
  })
}
// 获取公交
export const getRoute = (data) => {
  return instance({
    url: '/bus/get-route',
    method: 'post',
    data
  })
}
